<?php
define('FPDF_FONTPATH','../fpdf/font/');
require('pagegroup.php');
include ("../../include/config.php");
require_once ("../../include/db.php");



class PDF extends PDF_PageGroup
{
function Footer()
{
	$this->SetY(-20);
	$this->Cell(0, 6, 'Page '.$this->GroupPageNo().'/'.$this->PageGroupAlias(), 0, 0, 'C');
}
}

$pdf = new PDF();
$pdf->SetFont('Arial', '', 12);
$pdf->StartPageGroup();
// Gegevens ophalen.

$sql="SELECT DISTINCT Leerkrachtnaam,LeerkrachtID,Lokaal FROM $tbvak ORDER BY Leerkrachtnaam ASC ";
$result=mysql_query($sql);

while ($row = mysql_fetch_array($result)) {
	//$id[$teller] = $row['LeerkrachtID'];
	//$teller ++ ;
	$lknaam = $row['Leerkrachtnaam'];
	$lkid = $row['LeerkrachtID'];
	$lok = $row['Lokaal'];
	
			
	
$pdf->AddPage();
//$pdf->Image( "../images/alicebourg50.png" ,155 ,5,40,40);
$pdf->Write(5, $lknaam);
$pdf->Write(5, " ($lkid) ");
$pdf->Write(5, " ($lok) ");
$pdf->Write(5,"\n\n");
			$sqlres="SELECT * FROM $tbres WHERE Leerkrachtnaam='$lknaam' ";
			$resultres=mysql_query($sqlres);
				
				
				while ($rowres =mysql_fetch_array($resultres)) {
						$lln = $rowres['Gebruikersnaam'];
						$klas = $rowres['Klas'];
						$uur = $rowres['Uur'];
						$vak = $rowres['Vak'];
						
																
$pdf->Cell(30,6,$uur,1,0);
$pdf->Cell(85,6,$lln,1,1);

}}



$pdf->Output();

mysql_close();
?>